<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>基本信息</title> 
    <link href="css/base.css" rel="stylesheet">
    <link rel="stylesheet" href="jquery-easyui-1.5.3/themes/default/easyui.css">
    <link href="jquery-easyui-1.5.3/themes/icon.css" rel="stylesheet">
    <link href="css/basic_info.css" rel="stylesheet">
    <link rel="stylesheet" href="css/xk.css">
    <script type="text/javascript" src="font_jjkmvgsdpk/iconfont.js"></script>
    <link rel="stylesheet" href="font_jjkmvgsdpk/iconfont.css">
    <link href="css/process.css" rel="stylesheet">
</head> 
<body>
 <div class="container">
    <div class="xk_submit" style="height: 24px;background-color: #eeeeee;text-align: center;bottom: 0;right: 0;left: 0;position: fixed;"> 
    <button class="easyui-linkbutton" type="button" id="jzxxfy" iconCls="icon-large-clipart" style="height: 24px;margin-left: 5px;">打印</button>
    <button class="easyui-linkbutton" type="button" onclick="submit_fxyj_readonly()" iconCls="icon-save" style="height: 24px;margin-left: 5px;">保存</button>
  </div> 
 <div class="content">
  <form>
   <table class="xk_table">
   	<tr>
   		<td class="xk_label">现场分析依据的材料</td>
   		<td colspan="5">
   		<input type="checkbox" name=""><span>实地勘验</span>
   		<input type="checkbox" name=""><span>现场实验</span>
   		<input type="checkbox" name=""><span>调查访问</span>
   		<input type="checkbox" name=""><span>检验鉴定 </span>
   	   </td>
   	</tr>
   	<tr>
     <td class="xk_label">案件性质</td>
     <td class="td_input"><input type="text" id="ajxz_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="ajxz">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name=""></td>
    </tr>
    <tr>
     <td class="xk_label">选择对象</td>
     <td class="td_input"><input type="text" id="xzdx_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="xzdx">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">选择处所</td>
     <td class="td_input"><input type="text" id="xzcs_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="xzcs">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案时机</td>
     <td class="td_input"><input type="text" id="zasj_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zasj">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案入口</td>
     <td class="td_input"><input type="text" id="zark_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zark">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案出口</td>
     <td class="td_input"><input type="text" id="zack_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zack">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案手段</td>
     <td class="td_input"><input type="text" id="zasd_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zasd">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">侵入方式</td>
     <td class="td_input"><input type="text" id="qrfs_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="qrfs">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案特点</td>
     <td class="td_input"><input type="text" id="zatd_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zatd">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
    <tr>
     <td class="xk_label">作案动机目的</td>
     <td class="td_input"><input type="text" id="zadjmd_val" key="" readonly="readonly" class="xk_input96" name="">
      <svg class="icon" aria-hidden="true" id="zadjmd">
       <use xlink:href="#icon-shujuzidian"></use>
      </svg>	
     </td>
     <td class="td_input"><input type="text" class="xk_input96" name="">
    </tr>
   </table>
   <table class="xk_table" style="margin-top: 0">
   	<tr>
   		<td class="xk_label" style="width: 13.3%;">作案人数</td>
   		<td style="width: 12%;">
	      <select style="width: 97%;" class="xk_input96">
	       <option value="1">单人</option>
	       <option value="2">两人</option>
	       <option value="2">多人</option>
	       <option value="2">不确定</option>
	      </select>
        </td>
        <td><input type="text" name="" class="xk_input96" style="width: 30%;"></td>
   	</tr>
   	<tr>
   	 <td class="xk_label_L">作案地点</td>
   	 <td colspan="2"><input type="text" name="" class="xk_input96"></td>
   	</tr>
    <tr>
     <td class="xk_label_L">作案工具</td> 
     <td colspan="5">
      <button class="easyui-linkbutton" type="button" id="zagj_add_btn" iconCls="icon-add" style="height: 24px;float: right;">新增</button>
     </td> 
    </tr>
    <tr>
     <td colspan="6">
      <table class="xk_table02" id="zagj_table" style="margin-top: 0;">
       <tr>
        <th class="xk_label" style="width: 1.6%;">序号</th>
        <th class="xk_label">工具名称</th>
        <th class="xk_label">工具类目</th>
        <th class="xk_label">工具来源</th>
        <th class="xk_label">描述</th>
        <th class="xk_label" style="width: 1.6%;text-align: center;">操作</th>
       </tr>
       <tbody id="add_zagj_tr">
                 
       </tbody>
      </table>
     </td>
    </tr>
    <tr>
        <td class="xk_label_textarea02" style="height: 120px">作案过程</td>
        <td colspan="5"><textarea style="height: 106px;" type="text" class="xk_input_textarea02" name=""></textarea></td>
    </tr>
     <tr>
        <td class="xk_label_textarea02" style="height: 120px">作案人特点</td>
        <td colspan="5"><textarea style="height: 106px;" type="text" class="xk_input_textarea02" name=""></textarea></td>
    </tr>  
     <tr>
        <td class="xk_label_textarea02" style="height: 120px">串并意见与根据</td>
        <td colspan="5"><textarea style="height: 106px;" type="text" class="xk_input_textarea02" name=""></textarea></td>
    </tr>
    <tr>
     <td class="xk_label_L" rowspan="13">工作建议</td>
     <td colspan="2" style="width: 92%;" class="xk_label_L">关于痕迹物证的保管、检验、应用、建库与查询等意见</td>
    </tr>
    <tr>
     <td style="width: 92%;" colspan="2"><textarea type="text" class="xk_input_textarea" name=""></textarea></td> 	
    </tr>
    <tr>
    	<td colspan="2" style="width: 92%;" class="xk_label_L">关于现场保留、现场复勘、尸体处置等意见</td>
    </tr>
    <tr>
    	<td style="width: 92%;" colspan="2">
    	 <input type="checkbox" value="不保留" name="1_1"><span>不保留</span>
    	 <input type="checkbox" value="保留，待复勘" name="1_1"><span>保留，待复勘</span>
    	 <input type="checkbox" value="其他" name="1_1"><span>其他</span>	
    	</td>
    </tr>
    <tr>
     <td style="width: 92%;" colspan="2"><textarea type="text" class="xk_input_textarea" name="xcyj"></textarea></td> 	
    </tr>
    <tr>
    	<td colspan="2" style="width: 92%;" class="xk_label_L">关于侦查方向与范围、侦破措施及途径等意见</td>
    </tr>
    <tr>
    	<td style="width: 92%;" colspan="2">
    	 <input type="checkbox" value="围绕中心现场，展开走访调查工作" name="2_2"><span>围绕中心现场，展开走访调查工作</span>
    	 <input type="checkbox" value="研究案件串并案" name="2_2"><span>研究案件串并案</span>
    	 <input type="checkbox" value="调取相关视频资料" name="2_2"><span>调取相关视频资料</span>
    	 <input type="checkbox" value="控制销赃" name="2_2"><span>控制销赃</span>	
    	 <input type="checkbox" value="其他" name="2_2"><span>其他</span>		
    	</td>
    </tr>
    <tr>
     <td style="width: 92%;" colspan="2"><textarea type="text" class="xk_input_textarea" name="zcyj"></textarea></td> 	
    </tr>
    <tr>
    	<td colspan="2" style="width: 92%;" class="xk_label_L">关于技术防范对策</td>
    </tr>
    <tr>
    	<td style="width: 92%;" colspan="2">
    	 <input type="checkbox" value="加强防范工作" name="3_3"><span>加强防范工作</span>
    	 <input type="checkbox" value="加强巡逻伏击" name="3_3"><span>加强巡逻伏击</span>
    	 <input type="checkbox" value="加装监控" name="3_3"><span>加装监控</span>
    	 <input type="checkbox" value="安装防盗报警器" name="3_3"><span>安装防盗报警器</span>	
    	 <input type="checkbox" value="其他" name="3_3"><span>其他</span>		
    	</td>
    </tr>
    <tr>
     <td style="width: 92%;" colspan="2"><textarea type="text" class="xk_input_textarea" name="jsdc"></textarea></td> 	
    </tr>
    <tr>
    	<td colspan="2" style="width: 92%;" class="xk_label_L">其他</td>
    </tr>
    <tr>
     <td style="width: 92%;" colspan="2"><textarea type="text" class="xk_input_textarea" name=""></textarea></td> 	
    </tr>
    <tr>
   	 <td class="xk_label_L">现场分析单位</td>
   	 <td colspan="2"><input type="text" name="" class="xk_input96"></td>
   	</tr>           
   </table>
   <table class="xk_table" style="margin-top: 0;">
   	<tbody>
   	 <tr>
   	  <td style="width: 13.3%;" class="xk_label_L">现场分析人</td>
   	  <td><input type="text" class="xk_input96" name="" readonly="readonly" placeholder="测试刑科所"></td>
   	  <td style="width: 13.3%;" class="xk_label_L">现场分析时间</td>
   	  <td><input type="text" class="xk_input96" name="" readonly="readonly" placeholder="2019-04-28"></td>	
   	 </tr>	
   	</tbody>
   </table>
  </form>
 </div>
</div>
 <!-- 案件性质树 -->
<div id="div_ajxz_tree" class="easyui-dialog" closed="true">
 <div>
 	<input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="ajxz_vals" style="margin-left: 1%;">
 </div>	
 <ul id="ajxz_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_ajxz_chanyong">
   <li key="0" parentValue="">常用项</li>
 </ul>
</div>
 <!-- 选择对象树 -->
<div id="div_xzdx_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="xzdx_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="xzdx_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_xzdx_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 选择处所树 -->
<div id="div_xzcs_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="xzcs_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="xzcs_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_xzcs_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>	
 <!-- 作案时机树 -->
<div id="div_zasj_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zasj_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zasj_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zasj_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 作案入口树 -->
<div id="div_zark_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zark_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zark_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zark_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 作案出口树 -->
<div id="div_zack_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zack_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zack_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zack_chanyong">
   <li key="0">常用项</li>
 </ul>
</div> 
 <!-- 作案手段树 -->
<div id="div_zasd_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zasd_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zasd_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zasd_chanyong">
   <li key="0">常用项</li>
 </ul>
</div> 
 <!-- 侵入方式树 -->
<div id="div_qrfs_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="qrfs_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="qrfs_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_qrfs_chanyong">
   <li key="0">常用项</li>
 </ul>
</div> 
 <!-- 作案特点树 -->
<div id="div_zatd_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zatd_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zatd_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zatd_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 作案动机目的树 -->
<div id="div_zadjmd_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="zadjmd_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="zadjmd_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zadjmd_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
</body>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
<script type="text/javascript">
//高度适应
var x = $(".xk_submit").height();
$(".content").css("margin-bottom",x);
//作案工具table
var zagj = 0;
$("#zagj_add_btn").click(function(){
  var zagj_tr_num = ++zagj;
  $("#add_zagj_tr").append("<tr>"+
        "<th style='width: 1.6%;'>"+"<input type='' value='"+zagj_tr_num+"' name='' class='xk_input04'>"+"</th>"+
        "<th>"+
         "<input type='text' class='xk_input04' name=''>"+
        "</th>"+
         "<th>"+
         "<select class='xk_input04'>"+
         "<option></option>"+
          "<option>使用工具类</option>"+
          "<option>交通工具类</option>"+
          "<option>毒物类</option>"+
          "<option>爆炸物品类</option>"+	
          "<option>工艺首饰及文物类</option>"+
          "<option>家用电器类</option>"+	
          "<option>仪器仪表及计量器材类</option>"+	
         "</select>"+	
        "</th>"+	
        "<th>"+
         "<select class='xk_input04'>"+
         "<option></option>"+
          "<option>就地取材</option>"+
          "<option>随身携带</option>"+
          "<option>其他</option>"+	
         "</select>"+		
        "</th>"+
        "<th>"+
          "<input type='text' class='xk_input04' name=''>"+	
        "</th>"+
        "<th style='width: 1.6%;text-align: center;'>"+
         "<button class='easyui-linkbutton' type='button' onclick='zagj_tr_del(this)' id='jbxx_cancel' iconCls='icon-cancel'>删除</button>"+	
        "</th>"+	
       "</tr>");
        $.parser.parse("#zagj_table");
});
//删除一行作案工具
function zagj_tr_del(obj){
  //控制序号
  var count = $("#zagj_table").find("tr").length-1;
  //得到当前所在行
  var rows = obj.parentNode.parentNode.rowIndex;
  obj.parentNode.parentNode.remove();
  zagj--;
  if(rows <= count){
    for(var i = rows;i<=count;i++){
      var j = i-1;
      var val =$("#zagj_table tr:gt("+j+") th:eq(0)").find("input").first().val();
      var cou = val - 1;
      $("#zagj_table tr:gt("+j+") th:eq(0)").find("input").first().val(cou);
    }
  }
}
var my_array = new Array();
var value_array = new Array();
var changyong_vals = new Array();
var cy_prarent_vals = new Array();
i = 0;
j = 0;
cy_i = 0;
cy_j = 0;
var parentValue = "";
var value = "";
var key = "";
//对于重复选择的值,不保存
function testRecHasThe(s){
  for (i = 0; i < my_array.length; i++)
   {
     if( my_array[i] == s)      return false;     
   }
  return true;
}

$("#ajxz").click(function(){
  $("#div_ajxz_tree").dialog({
  title:"案件性质多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#ajxz_vals").val();
      $("#ajxz_val").val(val);
      $("#div_ajxz_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    my_array = [];
    value_array= [];
    changyong_vals= [];
    cy_prarent_vals= [];
    i = 0;
    j = 0;
    cy_i = 0;
    cy_j = 0;
    $("#ajxz_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(parentValue != null && parentValue.length != 0){
      if (value != null && value.length!= 0){
        for(var i = 0;i<=changyong_vals.length;i++){
          if(changyong_vals.indexOf(value) != -1){
            return false;
          }else{
            changyong_vals[cy_i++] = value;
            for(var c = 0;c<=cy_prarent_vals.length;c++){
              if(cy_prarent_vals[c] == parentValue){
                break;
              }else{
                cy_prarent_vals[cy_j++] = parentValue;
                break;
              }
            }
            $("#ul_ajxz_chanyong").append("<li key='"+key+"' parentValue="+parentValue+" onclick='ajxz_changyong_val(this)'><button class='easyui-linkbutton' onclick='ajxz_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+value+"</a></li>");
            $.parser.parse("#ul_ajxz_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//案件性质树
$("#ajxz_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#ajxz_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#ajxz_tree').tree('isLeaf',node.target)){
      parentValue = $('#ajxz_tree').tree("getParent",node.target).text;
      value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      key = node.id;

  if(testRecHasThe(value)){  
     if (value != "") {
        my_array[i++] = value;
        if (parentValue == null || parentValue == "") {
            value_array[j++] = value;
        } else {
            if (j == 0) {
                value_array[j++] = parentValue + "：" + value;
            } else {
                var flag = false;
                for (var k = 0; k < value_array.length; k++) {
                    var tempValue = value_array[k];
                    if (tempValue.indexOf(parentValue) != -1) {
                        value_array[k] = value_array[k] + "、" + value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) value_array[j++] = parentValue + "：" + value;
            }
        }
        var totalvalue = value_array.join("，");
         $("#ajxz_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#ajxz_tree').tree('isLeaf',node.target)){
     parentValue = $('#ajxz_tree').tree("getParent",node.target).text;
      value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      key = node.id;

  }
 }
});
$('#div_ajxz_tree').dialog('open'); //打开添加对话框
$('#div_ajxz_tree').window('center');//使Dialog居中显示  
}); 
//删除案件性质常用项
function ajxz_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<changyong_vals.length;i++){
    if(changyong_vals[i] == val){
      changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给案件性质框赋选定常用值
function ajxz_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(testRecHasThe(val)){  
     if (val != "") {
        my_array[i++] = val;
        if (val_val == null || val_val == "") {
            value_array[j++] = val;
        } else {
            if (j == 0) {
                value_array[j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < value_array.length; k++) {
                    var tempValue = value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        value_array[k] = value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) value_array[j++] = val_val + "：" + val;
            }
        }
        var totalvalue = value_array.join("，");
         $("#ajxz_vals").val(totalvalue);;
    }
  }
}
var xzdx_my_array = new Array();
var xzdx_value_array = new Array();
var xzdx_changyong_vals = new Array();
var xzdx_cy_prarent_vals = new Array();
xzdx_i = 0;
xzdx_j = 0;
xzdx_cy_i = 0;
xzdx_cy_j = 0;
var xzdx_parentValue = "";
var xzdx_value = "";
var xzdx_key = "";
//对于重复选择的值,不保存
function xzdx_RecHasThe(s){
  for (i = 0; i < xzdx_my_array.length; i++)
   {
     if( xzdx_my_array[i] == s)      return false;     
   }
  return true;
}

$("#xzdx").click(function(){
  $("#div_xzdx_tree").dialog({
  title:"选择对象多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#xzdx_vals").val();
      $("#xzdx_val").val(val);
      $("#div_xzdx_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    xzdx_my_array = [];
    xzdx_value_array= [];
    xzdx_changyong_vals= [];
    xzdx_cy_prarent_vals= [];
    xzdx_i = 0;
    xzdx_j = 0;
    xzdx_cy_i = 0;
    xzdx_cy_j = 0;
    $("#xzdx_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(xzdx_parentValue != null && xzdx_parentValue.length != 0){
      if (xzdx_value != null && xzdx_value.length!= 0){
        for(var i = 0;i<=xzdx_changyong_vals.length;i++){
          if(xzdx_changyong_vals.indexOf(xzdx_value) != -1){
            return false;
          }else{
            xzdx_changyong_vals[xzdx_cy_i++] = xzdx_value;
            for(var c = 0;c<=xzdx_cy_prarent_vals.length;c++){
              if(xzdx_cy_prarent_vals[c] == xzdx_parentValue){
                break;
              }else{
                xzdx_cy_prarent_vals[xzdx_cy_j++] = xzdx_parentValue;
                break;
              }
            }
            $("#ul_xzdx_chanyong").append("<li key='"+xzdx_key+"' parentValue="+xzdx_parentValue+" onclick='xzdx_changyong_val(this)'><button class='easyui-linkbutton' onclick='xzdx_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+xzdx_value+"</a></li>");
            $.parser.parse("#ul_xzdx_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//选择对象树
$("#xzdx_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#xzdx_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#xzdx_tree').tree('isLeaf',node.target)){
      xzdx_parentValue = $('#xzdx_tree').tree("getParent",node.target).text;
      xzdx_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      xzdx_key = node.id;

  if(xzdx_RecHasThe(xzdx_value)){  
     if (xzdx_value != "") {
        xzdx_my_array[xzdx_i++] = xzdx_value;
        if (xzdx_parentValue == null || xzdx_parentValue == "") {
            xzdx_value_array[xzdx_j++] = xzdx_value;
        } else {
            if (xzdx_j == 0) {
                xzdx_value_array[xzdx_j++] = xzdx_parentValue + "：" + xzdx_value;
            } else {
                var flag = false;
                for (var k = 0; k < xzdx_value_array.length; k++) {
                    var tempValue = xzdx_value_array[k];
                    if (tempValue.indexOf(xzdx_parentValue) != -1) {
                        xzdx_value_array[k] = xzdx_value_array[k] + "、" + xzdx_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) xzdx_value_array[xzdx_j++] = xzdx_parentValue + "：" + xzdx_value;
            }
        }
        var totalvalue = xzdx_value_array.join("，");
         $("#xzdx_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#xzdx_tree').tree('isLeaf',node.target)){
     xzdx_parentValue = $('#xzdx_tree').tree("getParent",node.target).text;
      xzdx_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      xzdx_key = node.id;

  }
 }
});
$('#div_xzdx_tree').dialog('open'); //打开添加对话框
$('#div_xzdx_tree').window('center');//使Dialog居中显示  
}); 
//删除选择对象常用项
function xzdx_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<xzdx_changyong_vals.length;i++){
    if(xzdx_changyong_vals[i] == val){
      xzdx_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给选择对象框赋选定常用值
function xzdx_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(xzdx_RecHasThe(val)){  
     if (val != "") {
        xzdx_my_array[xzdx_i++] = val;
        if (val_val == null || val_val == "") {
            xzdx_value_array[xzdx_j++] = val;
        } else {
            if (xzdx_j == 0) {
                xzdx_value_array[xzdx_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < xzdx_value_array.length; k++) {
                    var tempValue = xzdx_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        xzdx_value_array[k] = xzdx_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) xzdx_value_array[xzdx_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = xzdx_value_array.join("，");
         $("#xzdx_vals").val(totalvalue);;
    }
  }
}
var xzcs_my_array = new Array();
var xzcs_value_array = new Array();
var xzcs_changyong_vals = new Array();
var xzcs_cy_prarent_vals = new Array();
xzcs_i = 0;
xzcs_j = 0;
xzcs_cy_i = 0;
xzcs_cy_j = 0;
var xzcs_parentValue = "";
var xzcs_value = "";
var xzcs_key = "";
//对于重复选择的值,不保存
function xzcs_RecHasThe(s){
  for (i = 0; i < xzcs_my_array.length; i++)
   {
     if( xzcs_my_array[i] == s)      return false;     
   }
  return true;
}

$("#xzcs").click(function(){
  $("#div_xzcs_tree").dialog({
  title:"选择处所多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#xzcs_vals").val();
      $("#xzcs_val").val(val);
      $("#div_xzcs_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    xzcs_my_array = [];
    xzcs_value_array= [];
    xzcs_changyong_vals= [];
    xzcs_cy_prarent_vals= [];
    xzcs_i = 0;
    xzcs_j = 0;
    xzcs_cy_i = 0;
    xzcs_cy_j = 0;
    $("#xzcs_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(xzcs_parentValue != null && xzcs_parentValue.length != 0){
      if (xzcs_value != null && xzcs_value.length!= 0){
        for(var i = 0;i<=xzcs_changyong_vals.length;i++){
          if(xzcs_changyong_vals.indexOf(xzcs_value) != -1){
            return false;
          }else{
            xzcs_changyong_vals[xzcs_cy_i++] = xzcs_value;
            for(var c = 0;c<=xzcs_cy_prarent_vals.length;c++){
              if(xzcs_cy_prarent_vals[c] == xzcs_parentValue){
                break;
              }else{
                xzcs_cy_prarent_vals[xzcs_cy_j++] = xzcs_parentValue;
                break;
              }
            }
            $("#ul_xzcs_chanyong").append("<li key='"+xzcs_key+"' parentValue="+xzcs_parentValue+" onclick='xzcs_changyong_val(this)'><button class='easyui-linkbutton' onclick='xzcs_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+xzcs_value+"</a></li>");
            $.parser.parse("#ul_xzcs_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//选择对象树
$("#xzcs_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#xzcs_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#xzcs_tree').tree('isLeaf',node.target)){
      xzcs_parentValue = $('#xzcs_tree').tree("getParent",node.target).text;
      xzcs_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      xzcs_key = node.id;

  if(xzcs_RecHasThe(xzcs_value)){  
     if (xzcs_value != "") {
        xzcs_my_array[xzcs_i++] = xzcs_value;
        if (xzcs_parentValue == null || xzcs_parentValue == "") {
            xzcs_value_array[xzcs_j++] = xzcs_value;
        } else {
            if (xzcs_j == 0) {
                xzcs_value_array[xzcs_j++] = xzcs_parentValue + "：" + xzcs_value;
            } else {
                var flag = false;
                for (var k = 0; k < xzcs_value_array.length; k++) {
                    var tempValue = xzcs_value_array[k];
                    if (tempValue.indexOf(xzcs_parentValue) != -1) {
                        xzcs_value_array[k] = xzcs_value_array[k] + "、" + xzcs_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) xzcs_value_array[xzcs_j++] = xzcs_parentValue + "：" + xzcs_value;
            }
        }
        var totalvalue = xzcs_value_array.join("，");
         $("#xzcs_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#xzcs_tree').tree('isLeaf',node.target)){
     xzcs_parentValue = $('#xzcs_tree').tree("getParent",node.target).text;
      xzcs_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      xzcs_key = node.id;

  }
 }
});
$('#div_xzcs_tree').dialog('open'); //打开添加对话框
$('#div_xzcs_tree').window('center');//使Dialog居中显示  
}); 
//删除选择处所常用项
function xzcs_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<xzcs_changyong_vals.length;i++){
    if(xzcs_changyong_vals[i] == val){
      xzcs_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给选择处所框赋选定常用值
function xzcs_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(xzcs_RecHasThe(val)){  
     if (val != "") {
        xzcs_my_array[xzcs_i++] = val;
        if (val_val == null || val_val == "") {
            xzcs_value_array[xzcs_j++] = val;
        } else {
            if (xzcs_j == 0) {
                xzcs_value_array[xzcs_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < xzcs_value_array.length; k++) {
                    var tempValue = xzcs_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        xzcs_value_array[k] = xzcs_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) xzcs_value_array[xzcs_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = xzcs_value_array.join("，");
         $("#xzcs_vals").val(totalvalue);;
    }
  }
}
var zasj_my_array = new Array();
var zasj_value_array = new Array();
var zasj_changyong_vals = new Array();
var zasj_cy_prarent_vals = new Array();
zasj_i = 0;
zasj_j = 0;
zasj_cy_i = 0;
zasj_cy_j = 0;
var zasj_parentValue = "";
var zasj_value = "";
var zasj_key = "";
//对于重复选择的值,不保存
function zasj_RecHasThe(s){
  for (i = 0; i < zasj_my_array.length; i++)
   {
     if( zasj_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zasj").click(function(){
  $("#div_zasj_tree").dialog({
  title:"作案时机多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zasj_vals").val();
      $("#zasj_val").val(val);
      $("#div_zasj_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zasj_my_array = [];
    zasj_value_array= [];
    zasj_changyong_vals= [];
    zasj_cy_prarent_vals= [];
    zasj_i = 0;
    zasj_j = 0;
    zasj_cy_i = 0;
    zasj_cy_j = 0;
    $("#zasj_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zasj_parentValue != null && zasj_parentValue.length != 0){
      if (zasj_value != null && zasj_value.length!= 0){
        for(var i = 0;i<=zasj_changyong_vals.length;i++){
          if(zasj_changyong_vals.indexOf(zasj_value) != -1){
            return false;
          }else{
            zasj_changyong_vals[zasj_cy_i++] = zasj_value;
            for(var c = 0;c<=zasj_cy_prarent_vals.length;c++){
              if(zasj_cy_prarent_vals[c] == zasj_parentValue){
                break;
              }else{
                zasj_cy_prarent_vals[zasj_cy_j++] = zasj_parentValue;
                break;
              }
            }
            $("#ul_zasj_chanyong").append("<li key='"+zasj_key+"' parentValue="+zasj_parentValue+" onclick='zasj_changyong_val(this)'><button class='easyui-linkbutton' onclick='zasj_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zasj_value+"</a></li>");
            $.parser.parse("#ul_zasj_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案时机树
$("#zasj_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zasj_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zasj_tree').tree('isLeaf',node.target)){
      zasj_parentValue = $('#zasj_tree').tree("getParent",node.target).text;
      zasj_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zasj_key = node.id;

  if(zasj_RecHasThe(zasj_value)){  
     if (zasj_value != "") {
        zasj_my_array[zasj_i++] = zasj_value;
        if (zasj_parentValue == null || zasj_parentValue == "") {
            zasj_value_array[zasj_j++] = zasj_value;
        } else {
            if (zasj_j == 0) {
                zasj_value_array[zasj_j++] = zasj_parentValue + "：" + zasj_value;
            } else {
                var flag = false;
                for (var k = 0; k < zasj_value_array.length; k++) {
                    var tempValue = zasj_value_array[k];
                    if (tempValue.indexOf(zasj_parentValue) != -1) {
                        zasj_value_array[k] = zasj_value_array[k] + "、" + zasj_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zasj_value_array[zasj_j++] = zasj_parentValue + "：" + zasj_value;
            }
        }
        var totalvalue = zasj_value_array.join("，");
         $("#zasj_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zasj_tree').tree('isLeaf',node.target)){
     zasj_parentValue = $('#zasj_tree').tree("getParent",node.target).text;
      zasj_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zasj_key = node.id;

  }
 }
});
$('#div_zasj_tree').dialog('open'); //打开添加对话框
$('#div_zasj_tree').window('center');//使Dialog居中显示  
}); 
//删除作案时机常用项
function zasj_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zasj_changyong_vals.length;i++){
    if(zasj_changyong_vals[i] == val){
      zasj_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案时机框赋选定常用值
function zasj_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zasj_RecHasThe(val)){  
     if (val != "") {
        zasj_my_array[zasj_i++] = val;
        if (val_val == null || val_val == "") {
            zasj_value_array[zasj_j++] = val;
        } else {
            if (zasj_j == 0) {
                zasj_value_array[zasj_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zasj_value_array.length; k++) {
                    var tempValue = zasj_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zasj_value_array[k] = zasj_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zasj_value_array[zasj_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zasj_value_array.join("，");
         $("#zasj_vals").val(totalvalue);;
    }
  }
}
var zark_my_array = new Array();
var zark_value_array = new Array();
var zark_changyong_vals = new Array();
var zark_cy_prarent_vals = new Array();
zark_i = 0;
zark_j = 0;
zark_cy_i = 0;
zark_cy_j = 0;
var zark_parentValue = "";
var zark_value = "";
var zark_key = "";
//对于重复选择的值,不保存
function zark_RecHasThe(s){
  for (i = 0; i < zark_my_array.length; i++)
   {
     if( zark_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zark").click(function(){
  $("#div_zark_tree").dialog({
  title:"作案入口多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zark_vals").val();
      $("#zark_val").val(val);
      $("#div_zark_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zark_my_array = [];
    zark_value_array= [];
    zark_changyong_vals= [];
    zark_cy_prarent_vals= [];
    zark_i = 0;
    zark_j = 0;
    zark_cy_i = 0;
    zark_cy_j = 0;
    $("#zark_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zark_parentValue != null && zark_parentValue.length != 0){
      if (zark_value != null && zark_value.length!= 0){
        for(var i = 0;i<=zark_changyong_vals.length;i++){
          if(zark_changyong_vals.indexOf(zark_value) != -1){
            return false;
          }else{
            zark_changyong_vals[zark_cy_i++] = zark_value;
            for(var c = 0;c<=zark_cy_prarent_vals.length;c++){
              if(zark_cy_prarent_vals[c] == zark_parentValue){
                break;
              }else{
                zark_cy_prarent_vals[zark_cy_j++] = zark_parentValue;
                break;
              }
            }
            $("#ul_zark_chanyong").append("<li key='"+zark_key+"' parentValue="+zark_parentValue+" onclick='zark_changyong_val(this)'><button class='easyui-linkbutton' onclick='zark_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zark_value+"</a></li>");
            $.parser.parse("#ul_zark_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案入口树
$("#zark_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zark_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zark_tree').tree('isLeaf',node.target)){
      zark_parentValue = $('#zark_tree').tree("getParent",node.target).text;
      zark_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zark_key = node.id;

  if(zark_RecHasThe(zark_value)){  
     if (zark_value != "") {
        zark_my_array[zark_i++] = zark_value;
        if (zark_parentValue == null || zark_parentValue == "") {
            zark_value_array[zark_j++] = zark_value;
        } else {
            if (zark_j == 0) {
                zark_value_array[zark_j++] = zark_parentValue + "：" + zark_value;
            } else {
                var flag = false;
                for (var k = 0; k < zark_value_array.length; k++) {
                    var tempValue = zark_value_array[k];
                    if (tempValue.indexOf(zark_parentValue) != -1) {
                        zark_value_array[k] = zark_value_array[k] + "、" + zark_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zark_value_array[zark_j++] = zark_parentValue + "：" + zark_value;
            }
        }
        var totalvalue = zark_value_array.join("，");
         $("#zark_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zark_tree').tree('isLeaf',node.target)){
     zark_parentValue = $('#zark_tree').tree("getParent",node.target).text;
      zark_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zark_key = node.id;

  }
 }
});
$('#div_zark_tree').dialog('open'); //打开添加对话框
$('#div_zark_tree').window('center');//使Dialog居中显示  
}); 
//删除作案入口常用项
function zark_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zark_changyong_vals.length;i++){
    if(zark_changyong_vals[i] == val){
      zark_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案入口框赋选定常用值
function zark_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zark_RecHasThe(val)){  
     if (val != "") {
        zark_my_array[zark_i++] = val;
        if (val_val == null || val_val == "") {
            zark_value_array[zark_j++] = val;
        } else {
            if (zark_j == 0) {
                zark_value_array[zark_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zark_value_array.length; k++) {
                    var tempValue = zark_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zark_value_array[k] = zark_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zark_value_array[zark_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zark_value_array.join("，");
         $("#zark_vals").val(totalvalue);;
    }
  }
}
var zack_my_array = new Array();
var zack_value_array = new Array();
var zack_changyong_vals = new Array();
var zack_cy_prarent_vals = new Array();
zack_i = 0;
zack_j = 0;
zack_cy_i = 0;
zack_cy_j = 0;
var zack_parentValue = "";
var zack_value = "";
var zack_key = "";
//对于重复选择的值,不保存
function zack_RecHasThe(s){
  for (i = 0; i < zack_my_array.length; i++)
   {
     if( zack_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zack").click(function(){
  $("#div_zack_tree").dialog({
  title:"作案出口多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zack_vals").val();
      $("#zack_val").val(val);
      $("#div_zack_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zack_my_array = [];
    zack_value_array= [];
    zack_changyong_vals= [];
    zack_cy_prarent_vals= [];
    zack_i = 0;
    zack_j = 0;
    zack_cy_i = 0;
    zack_cy_j = 0;
    $("#zack_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zack_parentValue != null && zack_parentValue.length != 0){
      if (zack_value != null && zack_value.length!= 0){
        for(var i = 0;i<=zack_changyong_vals.length;i++){
          if(zack_changyong_vals.indexOf(zack_value) != -1){
            return false;
          }else{
            zack_changyong_vals[zack_cy_i++] = zack_value;
            for(var c = 0;c<=zack_cy_prarent_vals.length;c++){
              if(zack_cy_prarent_vals[c] == zack_parentValue){
                break;
              }else{
                zack_cy_prarent_vals[zack_cy_j++] = zack_parentValue;
                break;
              }
            }
            $("#ul_zack_chanyong").append("<li key='"+zack_key+"' parentValue="+zack_parentValue+" onclick='zack_changyong_val(this)'><button class='easyui-linkbutton' onclick='zack_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zack_value+"</a></li>");
            $.parser.parse("#ul_zack_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案出口树
$("#zack_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zack_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zack_tree').tree('isLeaf',node.target)){
      zack_parentValue = $('#zack_tree').tree("getParent",node.target).text;
      zack_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zack_key = node.id;

  if(zack_RecHasThe(zack_value)){  
     if (zack_value != "") {
        zack_my_array[zack_i++] = zack_value;
        if (zack_parentValue == null || zack_parentValue == "") {
            zack_value_array[zack_j++] = zack_value;
        } else {
            if (zack_j == 0) {
                zack_value_array[zack_j++] = zack_parentValue + "：" + zack_value;
            } else {
                var flag = false;
                for (var k = 0; k < zack_value_array.length; k++) {
                    var tempValue = zack_value_array[k];
                    if (tempValue.indexOf(zack_parentValue) != -1) {
                        zack_value_array[k] = zack_value_array[k] + "、" + zack_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zack_value_array[zack_j++] = zack_parentValue + "：" + zack_value;
            }
        }
        var totalvalue = zack_value_array.join("，");
         $("#zack_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zack_tree').tree('isLeaf',node.target)){
     zack_parentValue = $('#zack_tree').tree("getParent",node.target).text;
      zack_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zack_key = node.id;

  }
 }
});
$('#div_zack_tree').dialog('open'); //打开添加对话框
$('#div_zack_tree').window('center');//使Dialog居中显示  
}); 
//删除作案出口常用项
function zack_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zack_changyong_vals.length;i++){
    if(zack_changyong_vals[i] == val){
      zack_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案出口框赋选定常用值
function zack_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zack_RecHasThe(val)){  
     if (val != "") {
        zack_my_array[zack_i++] = val;
        if (val_val == null || val_val == "") {
            zack_value_array[zack_j++] = val;
        } else {
            if (zack_j == 0) {
                zack_value_array[zack_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zack_value_array.length; k++) {
                    var tempValue = zack_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zack_value_array[k] = zack_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zack_value_array[zack_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zack_value_array.join("，");
         $("#zack_vals").val(totalvalue);;
    }
  }
}
var zasd_my_array = new Array();
var zasd_value_array = new Array();
var zasd_changyong_vals = new Array();
var zasd_cy_prarent_vals = new Array();
zasd_i = 0;
zasd_j = 0;
zasd_cy_i = 0;
zasd_cy_j = 0;
var zasd_parentValue = "";
var zasd_value = "";
var zasd_key = "";
//对于重复选择的值,不保存
function zasd_RecHasThe(s){
  for (i = 0; i < zasd_my_array.length; i++)
   {
     if( zasd_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zasd").click(function(){
  $("#div_zasd_tree").dialog({
  title:"作案手段多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zasd_vals").val();
      $("#zasd_val").val(val);
      $("#div_zasd_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zasd_my_array = [];
    zasd_value_array= [];
    zasd_changyong_vals= [];
    zasd_cy_prarent_vals= [];
    zasd_i = 0;
    zasd_j = 0;
    zasd_cy_i = 0;
    zasd_cy_j = 0;
    $("#zasd_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zasd_parentValue != null && zasd_parentValue.length != 0){
      if (zasd_value != null && zasd_value.length!= 0){
        for(var i = 0;i<=zasd_changyong_vals.length;i++){
          if(zasd_changyong_vals.indexOf(zasd_value) != -1){
            return false;
          }else{
            zasd_changyong_vals[zasd_cy_i++] = zasd_value;
            for(var c = 0;c<=zasd_cy_prarent_vals.length;c++){
              if(zasd_cy_prarent_vals[c] == zasd_parentValue){
                break;
              }else{
                zasd_cy_prarent_vals[zasd_cy_j++] = zasd_parentValue;
                break;
              }
            }
            $("#ul_zasd_chanyong").append("<li key='"+zasd_key+"' parentValue="+zasd_parentValue+" onclick='zasd_changyong_val(this)'><button class='easyui-linkbutton' onclick='zasd_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zasd_value+"</a></li>");
            $.parser.parse("#ul_zasd_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案手段树
$("#zasd_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zasd_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zasd_tree').tree('isLeaf',node.target)){
      zasd_parentValue = $('#zasd_tree').tree("getParent",node.target).text;
      zasd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zasd_key = node.id;

  if(zasd_RecHasThe(zasd_value)){  
     if (zasd_value != "") {
        zasd_my_array[zasd_i++] = zasd_value;
        if (zasd_parentValue == null || zasd_parentValue == "") {
            zasd_value_array[zasd_j++] = zasd_value;
        } else {
            if (zasd_j == 0) {
                zasd_value_array[zasd_j++] = zasd_parentValue + "：" + zasd_value;
            } else {
                var flag = false;
                for (var k = 0; k < zasd_value_array.length; k++) {
                    var tempValue = zasd_value_array[k];
                    if (tempValue.indexOf(zasd_parentValue) != -1) {
                        zasd_value_array[k] = zasd_value_array[k] + "、" + zasd_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zasd_value_array[zasd_j++] = zasd_parentValue + "：" + zasd_value;
            }
        }
        var totalvalue = zasd_value_array.join("，");
         $("#zasd_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zasd_tree').tree('isLeaf',node.target)){
     zasd_parentValue = $('#zasd_tree').tree("getParent",node.target).text;
      zasd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zasd_key = node.id;

  }
 }
});
$('#div_zasd_tree').dialog('open'); //打开添加对话框
$('#div_zasd_tree').window('center');//使Dialog居中显示  
}); 
//删除作案手段常用项
function zasd_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zasd_changyong_vals.length;i++){
    if(zasd_changyong_vals[i] == val){
      zasd_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案手段框赋选定常用值
function zasd_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zasd_RecHasThe(val)){  
     if (val != "") {
        zasd_my_array[zasd_i++] = val;
        if (val_val == null || val_val == "") {
            zasd_value_array[zasd_j++] = val;
        } else {
            if (zasd_j == 0) {
                zasd_value_array[zasd_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zasd_value_array.length; k++) {
                    var tempValue = zasd_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zasd_value_array[k] = zasd_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zasd_value_array[zasd_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zasd_value_array.join("，");
         $("#zasd_vals").val(totalvalue);;
    }
  }
}
var qrfs_my_array = new Array();
var qrfs_value_array = new Array();
var qrfs_changyong_vals = new Array();
var qrfs_cy_prarent_vals = new Array();
qrfs_i = 0;
qrfs_j = 0;
qrfs_cy_i = 0;
qrfs_cy_j = 0;
var qrfs_parentValue = "";
var qrfs_value = "";
var qrfs_key = "";
//对于重复选择的值,不保存
function qrfs_RecHasThe(s){
  for (i = 0; i < qrfs_my_array.length; i++)
   {
     if( qrfs_my_array[i] == s)      return false;     
   }
  return true;
}

$("#qrfs").click(function(){
  $("#div_qrfs_tree").dialog({
  title:"侵入方式多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#qrfs_vals").val();
      $("#qrfs_val").val(val);
      $("#div_qrfs_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    qrfs_my_array = [];
    qrfs_value_array= [];
    qrfs_changyong_vals= [];
    qrfs_cy_prarent_vals= [];
    qrfs_i = 0;
    qrfs_j = 0;
    qrfs_cy_i = 0;
    qrfs_cy_j = 0;
    $("#qrfs_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(qrfs_parentValue != null && qrfs_parentValue.length != 0){
      if (qrfs_value != null && qrfs_value.length!= 0){
        for(var i = 0;i<=qrfs_changyong_vals.length;i++){
          if(qrfs_changyong_vals.indexOf(qrfs_value) != -1){
            return false;
          }else{
            qrfs_changyong_vals[qrfs_cy_i++] = qrfs_value;
            for(var c = 0;c<=qrfs_cy_prarent_vals.length;c++){
              if(qrfs_cy_prarent_vals[c] == qrfs_parentValue){
                break;
              }else{
                qrfs_cy_prarent_vals[qrfs_cy_j++] = qrfs_parentValue;
                break;
              }
            }
            $("#ul_qrfs_chanyong").append("<li key='"+qrfs_key+"' parentValue="+qrfs_parentValue+" onclick='qrfs_changyong_val(this)'><button class='easyui-linkbutton' onclick='qrfs_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+qrfs_value+"</a></li>");
            $.parser.parse("#ul_qrfs_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//侵入方式树
$("#qrfs_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#qrfs_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#qrfs_tree').tree('isLeaf',node.target)){
      qrfs_parentValue = $('#qrfs_tree').tree("getParent",node.target).text;
      qrfs_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      qrfs_key = node.id;

  if(qrfs_RecHasThe(qrfs_value)){  
     if (qrfs_value != "") {
        qrfs_my_array[qrfs_i++] = qrfs_value;
        if (qrfs_parentValue == null || qrfs_parentValue == "") {
            qrfs_value_array[qrfs_j++] = qrfs_value;
        } else {
            if (qrfs_j == 0) {
                qrfs_value_array[qrfs_j++] = qrfs_parentValue + "：" + qrfs_value;
            } else {
                var flag = false;
                for (var k = 0; k < qrfs_value_array.length; k++) {
                    var tempValue = qrfs_value_array[k];
                    if (tempValue.indexOf(qrfs_parentValue) != -1) {
                        qrfs_value_array[k] = qrfs_value_array[k] + "、" + qrfs_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) qrfs_value_array[qrfs_j++] = qrfs_parentValue + "：" + qrfs_value;
            }
        }
        var totalvalue = qrfs_value_array.join("，");
         $("#qrfs_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#qrfs_tree').tree('isLeaf',node.target)){
     qrfs_parentValue = $('#qrfs_tree').tree("getParent",node.target).text;
      qrfs_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      qrfs_key = node.id;

  }
 }
});
$('#div_qrfs_tree').dialog('open'); //打开添加对话框
$('#div_qrfs_tree').window('center');//使Dialog居中显示  
}); 
//删除侵入方式常用项
function qrfs_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<qrfs_changyong_vals.length;i++){
    if(qrfs_changyong_vals[i] == val){
      qrfs_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给侵入方式框赋选定常用值
function qrfs_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(qrfs_RecHasThe(val)){  
     if (val != "") {
        qrfs_my_array[qrfs_i++] = val;
        if (val_val == null || val_val == "") {
            qrfs_value_array[qrfs_j++] = val;
        } else {
            if (qrfs_j == 0) {
                qrfs_value_array[qrfs_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < qrfs_value_array.length; k++) {
                    var tempValue = qrfs_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        qrfs_value_array[k] = qrfs_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) qrfs_value_array[qrfs_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = qrfs_value_array.join("，");
         $("#qrfs_vals").val(totalvalue);;
    }
  }
}
var zatd_my_array = new Array();
var zatd_value_array = new Array();
var zatd_changyong_vals = new Array();
var zatd_cy_prarent_vals = new Array();
zatd_i = 0;
zatd_j = 0;
zatd_cy_i = 0;
zatd_cy_j = 0;
var zatd_parentValue = "";
var zatd_value = "";
var zatd_key = "";
//对于重复选择的值,不保存
function zatd_RecHasThe(s){
  for (i = 0; i < zatd_my_array.length; i++)
   {
     if( zatd_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zatd").click(function(){
  $("#div_zatd_tree").dialog({
  title:"作案特点多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zatd_vals").val();
      $("#zatd_val").val(val);
      $("#div_zatd_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zatd_my_array = [];
    zatd_value_array= [];
    zatd_changyong_vals= [];
    zatd_cy_prarent_vals= [];
    zatd_i = 0;
    zatd_j = 0;
    zatd_cy_i = 0;
    zatd_cy_j = 0;
    $("#zatd_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zatd_parentValue != null && zatd_parentValue.length != 0){
      if (zatd_value != null && zatd_value.length!= 0){
        for(var i = 0;i<=zatd_changyong_vals.length;i++){
          if(zatd_changyong_vals.indexOf(zatd_value) != -1){
            return false;
          }else{
            zatd_changyong_vals[zatd_cy_i++] = zatd_value;
            for(var c = 0;c<=zatd_cy_prarent_vals.length;c++){
              if(zatd_cy_prarent_vals[c] == zatd_parentValue){
                break;
              }else{
                zatd_cy_prarent_vals[zatd_cy_j++] = zatd_parentValue;
                break;
              }
            }
            $("#ul_zatd_chanyong").append("<li key='"+zatd_key+"' parentValue="+zatd_parentValue+" onclick='zatd_changyong_val(this)'><button class='easyui-linkbutton' onclick='zatd_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zatd_value+"</a></li>");
            $.parser.parse("#ul_zatd_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案特点树
$("#zatd_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zatd_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zatd_tree').tree('isLeaf',node.target)){
      zatd_parentValue = $('#zatd_tree').tree("getParent",node.target).text;
      zatd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zatd_key = node.id;

  if(zatd_RecHasThe(zatd_value)){  
     if (zatd_value != "") {
        zatd_my_array[zatd_i++] = zatd_value;
        if (zatd_parentValue == null || zatd_parentValue == "") {
            zatd_value_array[zatd_j++] = zatd_value;
        } else {
            if (zatd_j == 0) {
                zatd_value_array[zatd_j++] = zatd_parentValue + "：" + zatd_value;
            } else {
                var flag = false;
                for (var k = 0; k < zatd_value_array.length; k++) {
                    var tempValue = zatd_value_array[k];
                    if (tempValue.indexOf(zatd_parentValue) != -1) {
                        zatd_value_array[k] = zatd_value_array[k] + "、" + zatd_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zatd_value_array[zatd_j++] = zatd_parentValue + "：" + zatd_value;
            }
        }
        var totalvalue = zatd_value_array.join("，");
         $("#zatd_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zatd_tree').tree('isLeaf',node.target)){
     zatd_parentValue = $('#zatd_tree').tree("getParent",node.target).text;
      zatd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zatd_key = node.id;

  }
 }
});
$('#div_zatd_tree').dialog('open'); //打开添加对话框
$('#div_zatd_tree').window('center');//使Dialog居中显示  
}); 
//删除作案特点常用项
function zatd_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zatd_changyong_vals.length;i++){
    if(zatd_changyong_vals[i] == val){
      zatd_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案特点框赋选定常用值
function zatd_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zatd_RecHasThe(val)){  
     if (val != "") {
        zatd_my_array[zatd_i++] = val;
        if (val_val == null || val_val == "") {
            zatd_value_array[zatd_j++] = val;
        } else {
            if (zatd_j == 0) {
                zatd_value_array[zatd_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zatd_value_array.length; k++) {
                    var tempValue = zatd_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zatd_value_array[k] = zatd_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zatd_value_array[zatd_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zatd_value_array.join("，");
         $("#zatd_vals").val(totalvalue);;
    }
  }
}
var zadjmd_my_array = new Array();
var zadjmd_value_array = new Array();
var zadjmd_changyong_vals = new Array();
var zadjmd_cy_prarent_vals = new Array();
zadjmd_i = 0;
zadjmd_j = 0;
zadjmd_cy_i = 0;
zadjmd_cy_j = 0;
var zadjmd_parentValue = "";
var zadjmd_value = "";
var zadjmd_key = "";
//对于重复选择的值,不保存
function zadjmd_RecHasThe(s){
  for (i = 0; i < zadjmd_my_array.length; i++)
   {
     if( zadjmd_my_array[i] == s)      return false;     
   }
  return true;
}

$("#zadjmd").click(function(){
  $("#div_zadjmd_tree").dialog({
  title:"作案动机目的多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#zadjmd_vals").val();
      $("#zadjmd_val").val(val);
      $("#div_zadjmd_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    zadjmd_my_array = [];
    zadjmd_value_array= [];
    zadjmd_changyong_vals= [];
    zadjmd_cy_prarent_vals= [];
    zadjmd_i = 0;
    zadjmd_j = 0;
    zadjmd_cy_i = 0;
    zadjmd_cy_j = 0;
    $("#zadjmd_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(zadjmd_parentValue != null && zadjmd_parentValue.length != 0){
      if (zadjmd_value != null && zadjmd_value.length!= 0){
        for(var i = 0;i<=zadjmd_changyong_vals.length;i++){
          if(zadjmd_changyong_vals.indexOf(zadjmd_value) != -1){
            return false;
          }else{
            zadjmd_changyong_vals[zadjmd_cy_i++] = zadjmd_value;
            for(var c = 0;c<=zadjmd_cy_prarent_vals.length;c++){
              if(zadjmd_cy_prarent_vals[c] == zadjmd_parentValue){
                break;
              }else{
                zadjmd_cy_prarent_vals[zadjmd_cy_j++] = zadjmd_parentValue;
                break;
              }
            }
            $("#ul_zadjmd_chanyong").append("<li key='"+zadjmd_key+"' parentValue="+zadjmd_parentValue+" onclick='zadjmd_changyong_val(this)'><button class='easyui-linkbutton' onclick='zadjmd_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+zadjmd_value+"</a></li>");
            $.parser.parse("#ul_zadjmd_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//作案动机目的树
$("#zadjmd_tree").tree({
  url:'json/ajxz_tree.json',
 method:"get",
  onLoadSuccess:function(){  
   $("#zadjmd_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zadjmd_tree').tree('isLeaf',node.target)){
      zadjmd_parentValue = $('#zadjmd_tree').tree("getParent",node.target).text;
      zadjmd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zadjmd_key = node.id;

  if(zadjmd_RecHasThe(zadjmd_value)){  
     if (zadjmd_value != "") {
        zadjmd_my_array[zadjmd_i++] = zadjmd_value;
        if (zadjmd_parentValue == null || zadjmd_parentValue == "") {
            zadjmd_value_array[zadjmd_j++] = zadjmd_value;
        } else {
            if (zadjmd_j == 0) {
                zadjmd_value_array[zadjmd_j++] = zadjmd_parentValue + "：" + zadjmd_value;
            } else {
                var flag = false;
                for (var k = 0; k < zadjmd_value_array.length; k++) {
                    var tempValue = zadjmd_value_array[k];
                    if (tempValue.indexOf(zadjmd_parentValue) != -1) {
                        zadjmd_value_array[k] = zadjmd_value_array[k] + "、" + zadjmd_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zadjmd_value_array[zadjmd_j++] = zadjmd_parentValue + "：" + zadjmd_value;
            }
        }
        var totalvalue = zadjmd_value_array.join("，");
         $("#zadjmd_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#zadjmd_tree').tree('isLeaf',node.target)){
     zadjmd_parentValue = $('#zadjmd_tree').tree("getParent",node.target).text;
      zadjmd_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      zadjmd_key = node.id;

  }
 }
});
$('#div_zadjmd_tree').dialog('open'); //打开添加对话框
$('#div_zadjmd_tree').window('center');//使Dialog居中显示  
}); 
//删除作案动机目的常用项
function zadjmd_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<zadjmd_changyong_vals.length;i++){
    if(zadjmd_changyong_vals[i] == val){
      zadjmd_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给作案动机目的框赋选定常用值
function zadjmd_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(zadjmd_RecHasThe(val)){  
     if (val != "") {
        zadjmd_my_array[zadjmd_i++] = val;
        if (val_val == null || val_val == "") {
            zadjmd_value_array[zadjmd_j++] = val;
        } else {
            if (zadjmd_j == 0) {
                zadjmd_value_array[zadjmd_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < zadjmd_value_array.length; k++) {
                    var tempValue = zadjmd_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        zadjmd_value_array[k] = zadjmd_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) zadjmd_value_array[zadjmd_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = zadjmd_value_array.join("，");
         $("#zadjmd_vals").val(totalvalue);
    }
  }
}
//为关于现场保留、现场复勘、尸体处置等意见文本框赋值
var xc_val = new Array();
var xc_i = 0;
$("input[name=1_1]").change(function(){
  if(this.checked){
    xc_val[xc_i++] = $(this).val();
    var vals = xc_val.join("、");
    $("textarea[name=xcyj]").val(vals);  
  }else{
    var cancel_val = $(this).val();
    for(var j=0;j<xc_val.length;j++){
      if(xc_val[j].indexOf(cancel_val) != -1){
        xc_val.splice(j,1);
        xc_i--;
        var vals = xc_val.join("、");
        $("textarea[name=xcyj]").val(vals);  
      }
    } 
  }
 });
//为关于侦查方向与范围、侦破措施及途径等意见文本框赋值
var zc_val = new Array();
var zc_i = 0;
$("input[name=2_2]").change(function(){
  if(this.checked){
    zc_val[zc_i++] = $(this).val();
    var vals = zc_val.join("、");
    $("textarea[name=zcyj]").val(vals);  
  }else{
    var cancel_val = $(this).val();
    for(var j=0;j<zc_val.length;j++){
      if(zc_val[j].indexOf(cancel_val) != -1){
        zc_val.splice(j,1);
        zc_i--;
        var vals = zc_val.join("、");
        $("textarea[name=zcyj]").val(vals);  
      }
    } 
  }
 });
//关于技术防范对策
var dc_val = new Array();
var dc_i = 0;
$("input[name=3_3]").change(function(){
  if(this.checked){
    dc_val[dc_i++] = $(this).val();
    var vals = dc_val.join("、");
    $("textarea[name=jsdc]").val(vals);  
  }else{
    var cancel_val = $(this).val();
    for(var j=0;j<dc_val.length;j++){
      if(dc_val[j].indexOf(cancel_val) != -1){
        dc_val.splice(j,1);
        dc_i--;
        var vals = dc_val.join("、");
        $("textarea[name=jsdc]").val(vals);  
      }
    } 
  }
 });
function submit_fxyj_readonly() {
  window.location.href="fxyj_readonly";
}
</script>
</html>